home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / DB.PAK / DB.CPP next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  81 lines

  1. // db.cpp : Implementation of CDbApp and DLL registration.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "db.h"
  15.  
  16. #ifdef _DEBUG
  17. #undef THIS_FILE
  18. static char BASED_CODE THIS_FILE[] = __FILE__;
  19. #endif
  20.  
  21. CDbApp NEAR theApp;
  22.  
  23. const GUID CDECL BASED_CODE _tlid =
  24.         { 0xeff01748, 0x7825, 0x101b, { 0x83, 0x75, 0x0, 0xaa, 0x0, 0x37, 0x3f, 0xb9 } };
  25. const WORD _wVerMajor = 1;
  26. const WORD _wVerMinor = 0;
  27.  
  28. ////////////////////////////////////////////////////////////////////////////
  29. // CDbApp::InitInstance - DLL initialization
  30.  
  31. BOOL CDbApp::InitInstance()
  32. {
  33.     // wire up resources from the database DLL (OLE and core are automatic)
  34.     AfxDbInitModule();
  35.  
  36.     BOOL bInit = COleControlModule::InitInstance();
  37.     return bInit;
  38. }
  39.  
  40. ////////////////////////////////////////////////////////////////////////////
  41. // CDbApp::ExitInstance - DLL termination
  42.  
  43. int CDbApp::ExitInstance()
  44. {
  45.     return COleControlModule::ExitInstance();
  46. }
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // DllRegisterServer - Adds entries to the system registry
  50.  
  51. STDAPI DllRegisterServer(void)
  52. {
  53.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  54.  
  55.     if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
  56.         return ResultFromScode(SELFREG_E_TYPELIB);
  57.  
  58.     if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
  59.         return ResultFromScode(SELFREG_E_CLASS);
  60.  
  61.     return NOERROR;
  62. }
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65. // DllUnregisterServer - Removes entries from the system registry
  66.  
  67. STDAPI DllUnregisterServer(void)
  68. {
  69.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  70.  
  71.     if (!AfxOleUnregisterTypeLib(_tlid))
  72.         return ResultFromScode(SELFREG_E_TYPELIB);
  73.  
  74.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  75.         return ResultFromScode(SELFREG_E_CLASS);
  76.  
  77.     return NOERROR;
  78. }
  79.  
  80. /////////////////////////////////////////////////////////////////////////////
  81.